import { createRef } from "react";
import { Navigate, Outlet } from "react-router-dom";
import { SuspenseComponent } from "@/utils/MyFun";

const error = {
  name: "ErrorPage",
  path: "/error-page",
  element: <Outlet />,
  nodeRef: createRef(null),
  isHidden: true,
  meta: {
    title: "错误页",
    icon: "mdi:alert-circle-outline",
    order: 99,
  },
  children: [
    {
      path: "/error-page",
      nodeRef: createRef(null),
      element: <Navigate to="/error-page/404" />,
      redirect: true,
    },
    {
      name: "ERROR-404",
      path: "404",
      element: SuspenseComponent("/error-page"),
      nodeRef: createRef(null),
      meta: {
        title: "404",
        icon: "tabler:error-404",
      },
    },
  ],
};

export default error;
